package com.gitee.base.modules.core.model;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 角色表
 *
 * @author yang
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(value = "sys_role", autoResultMap = true)
public class SysRole implements Serializable {
    private static final long serialVersionUID = 20201108005731002L;

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    /**
     * 角色名称
     */
    @TableField("name")
    @NotBlank(message = "角色名不可为空")
    private String name;
    /**
     * 角色描述
     */
    @TableField("`desc`")
    private String desc;
    /**
     * 创建时间
     */
    @TableField(value = "ctime",fill = FieldFill.INSERT)
    private LocalDateTime ctime;
    /**
     * 更新时间
     */
    @TableField(value = "utime",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime utime;
    /**
     * 逻辑删除
     */
    @TableField("deleted")
    private Boolean deleted;

}
